// 设置 STOMP 客户端
var stompClient = null;
// 设置 WebSocket 进入端点
var SOCKET_ENDPOINT = "/websocket-endpoint";
// 设置订阅消息的请求前缀
var SUBSCRIBE_PREFIX = "/topic"
// 设置订阅消息的请求地址
var SUBSCRIBE = "/";
// 设置服务器端点，访问服务器中哪个接口
var SEND_ENDPOINT = "/app/test";

/* 进行连接 */
function connect() {

    // 设置 SOCKET
    var socket = new SockJS(SOCKET_ENDPOINT);
    // 配置 STOMP 客户端
    stompClient = Stomp.over(socket);
    // STOMP 客户端连接
    stompClient.connect({}, function (frame) {
        // alert("连接成功");
        //alert("connect");
    });
}

var pause=false;
var goon=false;
var terminate=false;

var no2ImgSrc="";
function subscribeTaskOtherStatus3(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/taskOtherData/" + encodeURIComponent(craneType);
    // 输出订阅地址
    // alert("设置订阅地址为：" + SUBSCRIBE);
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);
        $('#craneXVal3').val(receiveMessage.craneXVal);
        $('#craneZVal3').val(receiveMessage.craneZVal);
        switch(receiveMessage.runMode){
            case "1":
                $('#runMode3').val("本地遥控");
                break;
            case "2":
                $('#runMode3').val("本地机旁");
                break;
            case "3":
                $('#runMode3').val("本地自动");
                break;
            case "4":
                $('#runMode3').val("远程手动");
                break;
            case "5":
                $('#runMode3').val("远程自动");
                break;
            case "6":
                $('#runMode3').val("远程半自动");
                break;
            case "7":
                $('#runMode3').val("一键放料");
                break;
            default:
                $('#runMode3').val("无效模式");

        }
        switch(receiveMessage.isFault){
            case "FALSE":
                $("#isFault3").css("color", "white");
                $('#isFault3').val("正常");
                break;
            case "TRUE":
                $("#isFault3").css("color", "red");
                $('#isFault3').val("故障");
                break;
        }
        switch(receiveMessage.rollerLock){
            case "FALSE":
                $('#rollerLock3').val("否");
                break;
            case "TRUE":
                $('#rollerLock3').val("是");
                break;
        }
        switch(receiveMessage.suckSteel){
            case "FALSE":
                $('#suckSteel3').val("否");
                break;
            case "TRUE":
                $('#suckSteel3').val("是");
                break;
        }
        switch(receiveMessage.rollerReady){
            case "FALSE":
                $('#rollerReady3').val("否");
                break;
            case "TRUE":
                $('#rollerReady3').val("是");
                break;
        }
    });

}
function subscribeTaskOtherStatus4(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/taskOtherData/" + encodeURIComponent(craneType);
    // 输出订阅地址
    // alert("设置订阅地址为：" + SUBSCRIBE);
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);
        $('#craneXVal4').val(receiveMessage.craneXVal);
        $('#craneZVal4').val(receiveMessage.craneZVal);
        switch(receiveMessage.runMode){
            case "1":
                $('#runMode4').val("本地遥控");
                break;
            case "2":
                $('#runMode4').val("本地机旁");
                break;
            case "3":
                $('#runMode4').val("本地自动");
                break;
            case "4":
                $('#runMode4').val("远程手动");
                break;
            case "5":
                $('#runMode4').val("远程自动");
                break;
            case "6":
                $('#runMode4').val("远程半自动");
                break;
            case "7":
                $('#runMode4').val("一键放料");
                break;
            default:
                $('#runMode4').val("无效模式");

        }
        switch(receiveMessage.isFault){
            case "FALSE":
                $('#isFault4').val("正常");
                break;
            case "TRUE":
                $('#isFault4').addClass("redFont");
                $('#isFault4').val("故障");
                break;
        }
        switch(receiveMessage.rollerLock){
            case "FALSE":
                $('#rollerLock4').val("否");
                break;
            case "TRUE":
                $('#rollerLock4').val("是");
                break;
        }
        switch(receiveMessage.suckSteel){
            case "FALSE":
                $('#suckSteel4').val("否");
                break;
            case "TRUE":
                $('#suckSteel4').val("是");
                break;
        }
        switch(receiveMessage.rollerReady){
            case "FALSE":
                $('#rollerReady4').val("否");
                break;
            case "TRUE":
                $('#rollerReady4').val("是");
                break;
        }
    });

}
function subscribeTaskOtherStatus5(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/taskOtherData/" + encodeURIComponent(craneType);
    // 输出订阅地址
    // alert("设置订阅地址为：" + SUBSCRIBE);
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);
        $('#craneXVal5').val(receiveMessage.craneXVal);
        $('#craneZVal5').val(receiveMessage.craneZVal);
        switch(receiveMessage.runMode){
            case "1":
                $('#runMode5').val("本地遥控");
                break;
            case "2":
                $('#runMode5').val("本地机旁");
                break;
            case "3":
                $('#runMode5').val("本地自动");
                break;
            case "4":
                $('#runMode5').val("远程手动");
                break;
            case "5":
                $('#runMode5').val("远程自动");
                break;
            case "6":
                $('#runMode5').val("远程半自动");
                break;
            case "7":
                $('#runMode3').val("一键放料");
                break;
            default:
                $('#runMode5').val("无效模式");

        }
        switch(receiveMessage.isFault){
            case "FALSE":
                $('#isFault5').val("正常");
                break;
            case "TRUE":
                $('#isFault5').addClass("redFont");
                $('#isFault5').val("故障");
                break;
        }
        switch(receiveMessage.rollerLock){
            case "FALSE":
                $('#rollerLock5').val("否");
                break;
            case "TRUE":
                $('#rollerLock5').val("是");
                break;
        }
        switch(receiveMessage.suckSteel){
            case "FALSE":
                $('#suckSteel5').val("否");
                break;
            case "TRUE":
                $('#suckSteel5').val("是");
                break;
        }
        switch(receiveMessage.rollerReady){
            case "FALSE":
                $('#rollerReady5').val("否");
                break;
            case "TRUE":
                $('#rollerReady5').val("是");
                break;
        }
    });

}

//DJ2天车订阅信息
function subscribeTaskOtherStatus(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/taskOtherData/" + encodeURIComponent(craneType);
    // 输出订阅地址
    // alert("设置订阅地址为：" + SUBSCRIBE);
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);
        $('#craneXVal').val(receiveMessage.craneXVal);
        $('#craneZVal').val(receiveMessage.craneZVal);
        switch(receiveMessage.runMode){
            case "1":
                $('#runMode').val("本地遥控");
                break;
            case "2":
                $('#runMode').val("本地机旁");
                break;
            case "3":
                $('#runMode').val("本地自动");
                break;
            case "4":
                $('#runMode').val("远程手动");
                break;
            case "5":
                $('#runMode').val("远程自动");
                break;
            case "6":
                $('#runMode').val("远程半自动");
                break;
            case "7":
                $('#runMode').val("一键放料");
                break;
            default:
                $('#runMode').val("无效模式");

        }
        switch(receiveMessage.isFault){
            case "FALSE":
                $("#isFault").css("color", "white");
                $('#isFault').val("正常");
                break;
            case "TRUE":
                $("#isFault").css("color", "red");
                $('#isFault').val("故障");
                break;
        }
        switch(receiveMessage.rollerLock){
            case "FALSE":
                $('#rollerLock').val("否");
                break;
            case "TRUE":
                $('#rollerLock').val("是");
                break;
        }
        switch(receiveMessage.suckSteel){
            case "FALSE":
                $('#suckSteel').val("否");
                break;
            case "TRUE":
                $('#suckSteel').val("是");
                break;
        }
        switch(receiveMessage.rollerReady){
            case "FALSE":
                $('#rollerReady').val("否");
                $("#rollerReady").css("color", "red");
                break;
            case "TRUE":
                $('#rollerReady').val("是");
                $("#rollerReady").css("color", "white");
                break;
        }

        if('2#横移' !=  craneType && '3#横移' !=  craneType){
           switch(receiveMessage.selectSignal){
                    case "FALSE":
                        $('#selectSignal').val("否");
                        $("#selectSignal").css("color", "red");
                        break;
                    case "TRUE":
                        $('#selectSignal').val("是");
                        $("#selectSignal").css("color", "white");
                        break;
                }
        }

      if('11C北' ==  craneType || '11C南' ==  craneType){
           switch(receiveMessage.steelExceed){
                    case "FALSE":
                        $('#steelExceed').val("正常");
                        $("#steelExceed").css("color", "white");
                        break;
                    case "TRUE":
                        $('#steelExceed').val("超出");
                        $("#steelExceed").css("color", "red");
                        break;
                }
        }

    });

}

//订阅任务信息
function subscribeTaskStatus(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/taskData/" + encodeURIComponent(craneType);
    // 输出订阅地址
    // alert("设置订阅地址为：" + SUBSCRIBE);
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);
        $('#nowStatus').val(receiveMessage.nowStatus);
        if(receiveMessage.nowStatus == '暂停中'){
            $('#pause').removeClass('layui-btn-normal');
            $('#pause').addClass('layui-btn-danger');
        } else {
            $('#pause').removeClass('layui-btn-danger');
            $('#pause').addClass('layui-btn-normal');
        };

        //add  by zhangwei   前端增加堆张数的更新
        if (receiveMessage.stockNumberFlag){
            $('#stockNumberInput').val(receiveMessage.stockNumber);
        }
            $('#suckSteelNum').val(receiveMessage.suckedNum);

        no2ImgSrc=receiveMessage.no2ImgSrc;

        $('#nowTask').val(receiveMessage.nowTask);
        $('#unnormalStatus').val(receiveMessage.unnormalStatus);
        switch(receiveMessage.nowMode){
            case "offline":
                $('#nowMode').val("下线");
                break;
            case "online":
                $('#nowMode').val("上线");
                break;
            case "move":
                $('#nowMode').val("移动");
                break;
            default:
                $('#nowMode').val("");

        }
        // $('#nowTask').val(receiveMessage.nowTask);

        switch(receiveMessage.nowStep){
            case "move1":
                if(receiveMessage.nowMode=="offline"){
                    $('#nowStep').val("移动到辊道");
                }else if(receiveMessage.nowMode=="online"){
                    $('#nowStep').val("移动到垛位");
                }
                break;
            case "suck2":
                $('#nowStep').val("吸板");
                break;
            case "move3":
                if(receiveMessage.nowMode=="offline"){
                    $('#nowStep').val("移动到垛位");
                }else if(receiveMessage.nowMode=="online"){
                    $('#nowStep').val("移动到辊道");
                }
                break;
            case "place4":
                $('#nowStep').val("放板");
                break;
            case "suck":
                $('#nowStep').val("吸板");
                break;
            case "place":
                $('#nowStep').val("放板");
                break;
            case "suck-stock":
                $('#nowStep').val("吸板");
                break;
            case "place-roller":
                $('#nowStep').val("放板");
                break;
            default:
                $('#nowStep').val("");

        }
        $('#nowSteel').val(receiveMessage.nowSteelNum);


        // $("#information").append("<tr><td>" + receiveMessage.content + "</td></tr>");
    });

}

function subscribeTaskStatus3(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/taskData/" + encodeURIComponent(craneType);
    // 输出订阅地址
    // alert("设置订阅地址为：" + SUBSCRIBE);
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);


        console.log(responseBody.body);
        $('#nowStatus3').val(receiveMessage.nowStatus);
        if(receiveMessage.nowStatus == '暂停中'){
            $('#pause').addClass('layui-btn-danger');
        } else {
            $('#pause').addClass('layui-btn-normal');
        };
        $('#nowTask3').val(receiveMessage.nowTask);
        $('#unnormalStatus3').val(receiveMessage.unnormalStatus);
        switch(receiveMessage.nowMode){
            case "offline":
                $('#nowMode3').val("下线");
                break;
            case "online":
                $('#nowMode3').val("上线");
                break;
            case "move":
                $('#nowMode3').val("移动");
                break;
            default:
                $('#nowMode3').val("");

        }
        // $('#nowTask').val(receiveMessage.nowTask);

        switch(receiveMessage.nowStep){
            case "move1":
                if(receiveMessage.nowMode=="offline"){
                    $('#nowStep3').val("移动到辊道");
                }else if(receiveMessage.nowMode=="online"){
                    $('#nowStep3').val("移动到垛位");
                }
                break;
            case "suck2":
                $('#nowStep3').val("吸板");
                break;
            case "move3":
                if(receiveMessage.nowMode=="offline"){
                    $('#nowStep3').val("移动到垛位");
                }else if(receiveMessage.nowMode=="online"){
                    $('#nowStep3').val("移动到辊道");
                }
                break;
            case "place4":
                $('#nowStep3').val("放板");
                break;
            case "suck":
                $('#nowStep3').val("吸板");
                break;
            case "place":
                $('#nowStep3').val("放板");
                break;
            case "suck-stock":
                $('#nowStep3').val("吸板");
                break;
            case "place-roller":
                $('#nowStep3').val("放板");
                break;
            default:
                $('#nowStep3').val("");

        }
        $('#nowSteel3').val(receiveMessage.nowSteelNum);


        // $("#information").append("<tr><td>" + receiveMessage.content + "</td></tr>");
    });

}

function subscribeTaskStatus4(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/taskData/" + encodeURIComponent(craneType);
    // 输出订阅地址
    // alert("设置订阅地址为：" + SUBSCRIBE);
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);


        console.log(responseBody.body);
        $('#nowStatus4').val(receiveMessage.nowStatus);
        if(receiveMessage.nowStatus == '暂停中'){
            $('#pause').addClass('layui-btn-danger');
        } else {
            $('#pause').addClass('layui-btn-normal');
        };
        $('#nowTask4').val(receiveMessage.nowTask);
        $('#unnormalStatus4').val(receiveMessage.unnormalStatus);
        switch(receiveMessage.nowMode){
            case "offline":
                $('#nowMode4').val("下线");
                break;
            case "online":
                $('#nowMode4').val("上线");
                break;
            case "move":
                $('#nowMode4').val("移动");
                break;
            default:
                $('#nowMode4').val("");

        }
        // $('#nowTask').val(receiveMessage.nowTask);

        switch(receiveMessage.nowStep){
            case "move1":
                if(receiveMessage.nowMode=="offline"){
                    $('#nowStep4').val("移动到辊道");
                }else if(receiveMessage.nowMode=="online"){
                    $('#nowStep4').val("移动到垛位");
                }
                break;
            case "suck2":
                $('#nowStep4').val("吸板");
                break;
            case "move3":
                if(receiveMessage.nowMode=="offline"){
                    $('#nowStep4').val("移动到垛位");
                }else if(receiveMessage.nowMode=="online"){
                    $('#nowStep4').val("移动到辊道");
                }
                break;
            case "place4":
                $('#nowStep4').val("放板");
                break;
            case "suck":
                $('#nowStep4').val("吸板");
                break;
            case "place":
                $('#nowStep4').val("放板");
                break;
            case "suck-stock":
                $('#nowStep4').val("吸板");
                break;
            case "place-roller":
                $('#nowStep4').val("放板");
                break;
            default:
                $('#nowStep4').val("");

        }
        $('#nowSteel4').val(receiveMessage.nowSteelNum);


        // $("#information").append("<tr><td>" + receiveMessage.content + "</td></tr>");
    });

}

function subscribeTaskStatus5(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/taskData/" + encodeURIComponent(craneType);
    // 输出订阅地址
    // alert("设置订阅地址为：" + SUBSCRIBE);
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);


        console.log(responseBody.body);
        $('#nowStatus5').val(receiveMessage.nowStatus);
        if(receiveMessage.nowStatus == '暂停中'){
            $('#pause').addClass('layui-btn-danger');
        } else {
            $('#pause').addClass('layui-btn-normal');
        };
        $('#nowTask5').val(receiveMessage.nowTask);
        $('#unnormalStatus5').val(receiveMessage.unnormalStatus);
        switch(receiveMessage.nowMode){
            case "offline":
                $('#nowMode5').val("下线");
                break;
            case "online":
                $('#nowMode5').val("上线");
                break;
            case "move":
                $('#nowMode5').val("移动");
                break;
            default:
                $('#nowMode5').val("");

        }
        // $('#nowTask').val(receiveMessage.nowTask);

        switch(receiveMessage.nowStep){
            case "move1":
                if(receiveMessage.nowMode=="offline"){
                    $('#nowStep5').val("移动到辊道");
                }else if(receiveMessage.nowMode=="online"){
                    $('#nowStep5').val("移动到垛位");
                }
                break;
            case "suck2":
                $('#nowStep5').val("吸板");
                break;
            case "move3":
                if(receiveMessage.nowMode=="offline"){
                    $('#nowStep5').val("移动到垛位");
                }else if(receiveMessage.nowMode=="online"){
                    $('#nowStep5').val("移动到辊道");
                }
                break;
            case "place4":
                $('#nowStep5').val("放板");
                break;
            case "suck":
                $('#nowStep5').val("吸板");
                break;
            case "place":
                $('#nowStep5').val("放板");
                break;
            case "suck-stock":
                $('#nowStep5').val("吸板");
                break;
            case "place-roller":
                $('#nowStep5').val("放板");
                break;
            default:
                $('#nowStep5').val("");

        }
        $('#nowSteel5').val(receiveMessage.nowSteelNum);


        // $("#information").append("<tr><td>" + receiveMessage.content + "</td></tr>");
    });

}
/*var no2NowXval=0;
var no3NowXval=0;
var no4NowXval=0;
var no5NowXval=0;
var dj2NowXval=0;
var dj3NowXval=0;*/

var nowCraneXVal=0;
var no3NowXval=0;
var no4NowXval=0;
var no5NowXval=0;


function subscribePlcData3(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/" + "plcData/"+encodeURIComponent(craneType);

    // 输出订阅地址
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);
        no3NowXval = parseFloat(receiveMessage.x);
    });
}
function subscribePlcData4(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/" + "plcData/"+encodeURIComponent(craneType);

    // 输出订阅地址
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);
        no4NowXval = parseFloat(receiveMessage.x);
    });
}
function subscribePlcData5(craneType) {
    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/" + "plcData/"+encodeURIComponent(craneType);

    // 输出订阅地址
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);
        no5NowXval = parseFloat(receiveMessage.x);
    });
}
function subscribePlcData(craneType) {
        // 设置订阅地址
        SUBSCRIBE = SUBSCRIBE_PREFIX + "/" + "plcData/"+encodeURIComponent(craneType);

        // 输出订阅地址
        // 执行订阅消息
        stompClient.subscribe(SUBSCRIBE, function (responseBody) {
            var receiveMessage = JSON.parse(responseBody.body);
            nowCraneXVal= parseFloat(receiveMessage.x);
            /*if(craneType=="5#横移"){
                no5NowXval= parseFloat(receiveMessage.x);
            }
            if(craneType=="4#横移"){
                no4NowXval= parseFloat(receiveMessage.x);
            }
            if(craneType=="3#横移"){
                no3NowXval= parseFloat(receiveMessage.x);
            }
            if(craneType=="2#横移"){
                no2NowXval= parseFloat(receiveMessage.x);
            }
            if(craneType=="11C北"){
                dj2NowXval= parseFloat(receiveMessage.x);
            }
            if(craneType=="11C南"){
                dj3NowXval= parseFloat(receiveMessage.x);
            }*/


            if(receiveMessage.magnetBlock1=="TRUE"||receiveMessage.magnetBlock1=="true"){
                $('#magnetBlock1').prop('checked', true);
            }else if(receiveMessage.magnetBlock1=="FALSE"||receiveMessage.magnetBlock1=="false"){
                $('#magnetBlock1').prop('checked', false);
            }
            if(receiveMessage.magnetBlock2=="TRUE"||receiveMessage.magnetBlock2=="true"){
                $('#magnetBlock2').prop('checked', true);
            }else if(receiveMessage.magnetBlock2=="FALSE"||receiveMessage.magnetBlock2=="false"){
                $('#magnetBlock2').prop('checked', false);
            }
            if(receiveMessage.magnetBlock3=="TRUE"||receiveMessage.magnetBlock3=="true"){
                $('#magnetBlock3').prop('checked', true);
            }else if(receiveMessage.magnetBlock3=="FALSE"||receiveMessage.magnetBlock3=="false"){
                $('#magnetBlock3').prop('checked', false);
            }
            if(receiveMessage.magnetBlock4=="TRUE"||receiveMessage.magnetBlock4=="true"){
                $('#magnetBlock4').prop('checked', true);
            }else if(receiveMessage.magnetBlock4=="FALSE"||receiveMessage.magnetBlock4=="false"){
                $('#magnetBlock4').prop('checked', false);
            }
            if(receiveMessage.magnetBlock5=="TRUE"||receiveMessage.magnetBlock5=="true"){
                $('#magnetBlock5').prop('checked', true);
            }else if(receiveMessage.magnetBlock5=="FALSE"||receiveMessage.magnetBlock5=="false"){
                $('#magnetBlock5').prop('checked', false);
            }
            if(receiveMessage.magnetBlock6=="TRUE"||receiveMessage.magnetBlock6=="true"){
                $('#magnetBlock6').prop('checked', true);
            }else if(receiveMessage.magnetBlock6=="FALSE"||receiveMessage.magnetBlock6=="false"){
                $('#magnetBlock6').prop('checked', false);
            }
            if(receiveMessage.magnetBlock7=="TRUE"||receiveMessage.magnetBlock7=="true"){
                $('#magnetBlock7').prop('checked', true);
            }else if(receiveMessage.magnetBlock7=="FALSE"||receiveMessage.magnetBlock7=="false"){
                $('#magnetBlock7').prop('checked', false);
            }
            if(receiveMessage.magnetBlock8=="TRUE"||receiveMessage.magnetBlock8=="true"){
                $('#magnetBlock8').prop('checked', true);
            }else if(receiveMessage.magnetBlock8=="FALSE"||receiveMessage.magnetBlock8=="false"){
                $('#magnetBlock8').prop('checked', false);
            }
            $('#magnetValue').val(receiveMessage.magnetValue);

            $('#magnetBlockVal1').val(receiveMessage.magnetBlockVal1);
            $('#magnetBlockVal2').val(receiveMessage.magnetBlockVal2);
            $('#magnetBlockVal3').val(receiveMessage.magnetBlockVal3);
            $('#magnetBlockVal4').val(receiveMessage.magnetBlockVal4);
            $('#magnetBlockVal5').val(receiveMessage.magnetBlockVal5);
            $('#magnetBlockVal6').val(receiveMessage.magnetBlockVal6);
            $('#magnetBlockVal7').val(receiveMessage.magnetBlockVal7);
            $('#magnetBlockVal8').val(receiveMessage.magnetBlockVal8);

            if(receiveMessage.zhDY=="TRUE"||receiveMessage.zhDY=="true"){
                $('#zhDY').removeClass();
                $('#zhDY').addClass('redLight');
            }else if(receiveMessage.zhDY=="FALSE"||receiveMessage.zhDY=="false"){
                $('#zhDY').removeClass();
                $('#zhDY').addClass('greenLight');
            }
            if(receiveMessage.zhJChQ=="TRUE"||receiveMessage.zhJChQ=="true"){
                $('#zhJChQ').removeClass();
                $('#zhJChQ').addClass('redLight');
            }else if(receiveMessage.zhJChQ=="FALSE"||receiveMessage.zhJChQ=="false"){
                $('#zhJChQ').removeClass();
                $('#zhJChQ').addClass('greenLight');
            }
            if(receiveMessage.zhCh=="TRUE"||receiveMessage.zhCh=="true"){
                $('#zhCh').removeClass();
                $('#zhCh').addClass('redLight');
            }else if(receiveMessage.zhCh=="FALSE"||receiveMessage.zhCh=="false"){
                $('#zhCh').removeClass();
                $('#zhCh').addClass('greenLight');
            }
            if(receiveMessage.dChDY=="TRUE"||receiveMessage.dChDY=="true"){
                $('#dChDY').removeClass();
                $('#dChDY').addClass('redLight');
            }else if(receiveMessage.dChDY=="FALSE"||receiveMessage.dChDY=="false"){
                $('#dChDY').removeClass();
                $('#dChDY').addClass('greenLight');
            }
            if(receiveMessage.qShDY=="TRUE"||receiveMessage.qShDY=="true"){
                $('#qShDY').removeClass();
                $('#qShDY').addClass('redLight');
            }else if(receiveMessage.qShDY=="FALSE"||receiveMessage.qShDY=="false"){
                $('#qShDY').removeClass();
                $('#qShDY').addClass('greenLight');
            }
            if(receiveMessage.mXW1=="TRUE"||receiveMessage.mXW1=="true"){
                $('#mXW1').removeClass();
                $('#mXW1').addClass('redLight');
            }else if(receiveMessage.mXW1=="FALSE"||receiveMessage.mXW1=="false"){
                $('#mXW1').removeClass();
                $('#mXW1').addClass('greenLight');
            }
            if(receiveMessage.mXW2=="TRUE"||receiveMessage.mXW2=="true"){
                $('#mXW2').removeClass();
                $('#mXW2').addClass('redLight');
            }else if(receiveMessage.mXW2=="FALSE"||receiveMessage.mXW2=="false"){
                $('#mXW2').removeClass();
                $('#mXW2').addClass('greenLight');
            }
            if(receiveMessage.chShTX=="TRUE"||receiveMessage.chShTX=="true"){
                $('#chShTX').removeClass();
                $('#chShTX').addClass('redLight');
            }else if(receiveMessage.chShTX=="FALSE"||receiveMessage.chShTX=="false"){
                $('#chShTX').removeClass();
                $('#chShTX').addClass('greenLight');
            }
            if(receiveMessage.dJTX=="TRUE"||receiveMessage.dJTX=="true"){
                $('#dJTX').removeClass();
                $('#dJTX').addClass('redLight');
            }else if(receiveMessage.dJTX=="FALSE"||receiveMessage.dJTX=="false"){
                $('#dJTX').removeClass();
                $('#dJTX').addClass('greenLight');
            }
            if(receiveMessage.shCTX=="TRUE"||receiveMessage.shCTX=="true"){
                $('#shCTX').removeClass();
                $('#shCTX').addClass('redLight');
            }else if(receiveMessage.shCTX=="FALSE"||receiveMessage.shCTX=="false"){
                $('#shCTX').removeClass();
                $('#shCTX').addClass('greenLight');
            }
            if(receiveMessage.bP1GZh=="TRUE"||receiveMessage.bP1GZh=="true"){
                $('#bP1GZh').removeClass();
                $('#bP1GZh').addClass('redLight');
                $('#bP1GZhCode').html(receiveMessage.bP1GZhCode);
            }else if(receiveMessage.bP1GZh=="FALSE"||receiveMessage.bP1GZh=="false"){
                $('#bP1GZh').removeClass();
                $('#bP1GZh').addClass('greenLight');
            }
            if(receiveMessage.bP2GZh=="TRUE"||receiveMessage.bP2GZh=="true"){
                $('#bP2GZh').removeClass();
                $('#bP2GZh').addClass('redLight');
                $('#bP2GZhCode').html(receiveMessage.bP2GZhCode);
            }else if(receiveMessage.bP2GZh=="FALSE"||receiveMessage.bP2GZh=="false"){
                $('#bP2GZh').removeClass();
                $('#bP2GZh').addClass('greenLight');
            }
            if(receiveMessage.zXW=="TRUE"||receiveMessage.zXW=="true"){
                $('#zXW').removeClass();
                $('#zXW').addClass('redLight');
            }else if(receiveMessage.zXW=="FALSE"||receiveMessage.zXW=="false"){
                $('#zXW').removeClass();
                $('#zXW').addClass('greenLight');
            }
            if(receiveMessage.yXW=="TRUE"||receiveMessage.yXW=="true"){
                $('#yXW').removeClass();
                $('#yXW').addClass('redLight');
            }else if(receiveMessage.yXW=="FALSE"||receiveMessage.yXW=="false"){
                $('#yXW').removeClass();
                $('#yXW').addClass('greenLight');
            }
            if(receiveMessage.qShBP1GZh=="TRUE"||receiveMessage.qShBP1GZh=="true"){
                $('#qShBP1GZh').removeClass();
                $('#qShBP1GZh').addClass('redLight');
                $('#qShBP1GZhCode').html(receiveMessage.qShBP1GZhCode);
            }else if(receiveMessage.qShBP1GZh=="FALSE"||receiveMessage.qShBP1GZh=="false"){
                $('#qShBP1GZh').removeClass();
                $('#qShBP1GZh').addClass('greenLight');
            }
            if(receiveMessage.qShBP2GZh=="TRUE"||receiveMessage.qShBP2GZh=="true"){
                $('#qShBP2GZh').removeClass();
                $('#qShBP2GZh').addClass('redLight');
                $('#qShBP2GZhCode').html(receiveMessage.qShBP2GZhCode);
            }else if(receiveMessage.qShBP2GZh=="FALSE"||receiveMessage.qShBP2GZh=="false"){
                $('#qShBP2GZh').removeClass();
                $('#qShBP2GZh').addClass('greenLight');
            }
            if(receiveMessage.dX1ShXW=="TRUE"||receiveMessage.dX1ShXW=="true"){
                $('#dX1ShXW').removeClass();
                $('#dX1ShXW').addClass('redLight');
            }else if(receiveMessage.dX1ShXW=="FALSE"||receiveMessage.dX1ShXW=="false"){
                $('#dX1ShXW').removeClass();
                $('#dX1ShXW').addClass('greenLight');
            }
            if(receiveMessage.dX2ShXW=="TRUE"||receiveMessage.dX2ShXW=="true"){
                $('#dX2ShXW').removeClass();
                $('#dX2ShXW').addClass('redLight');
            }else if(receiveMessage.dX2ShXW=="FALSE"||receiveMessage.dX2ShXW=="false"){
                $('#dX2ShXW').removeClass();
                $('#dX2ShXW').addClass('greenLight');
            }
            if(receiveMessage.dCDJJ1=="TRUE"||receiveMessage.dCDJJ1=="true"){
                $('#dCDJJ1').removeClass();
                $('#dCDJJ1').addClass('redLight');
            }else if(receiveMessage.dCDJJ1=="FALSE"||receiveMessage.dCDJJ1=="false"){
                $('#dCDJJ1').removeClass();
                $('#dCDJJ1').addClass('greenLight');
            }
            if(receiveMessage.dCDJJ2=="TRUE"||receiveMessage.dCDJJ2=="true"){
                $('#dCDJJ2').removeClass();
                $('#dCDJJ2').addClass('redLight');
            }else if(receiveMessage.dCDJJ2=="FALSE"||receiveMessage.dCDJJ2=="false"){
                $('#dCDJJ2').removeClass();
                $('#dCDJJ2').addClass('greenLight');
            }
            if(receiveMessage.dCDJX1=="TRUE"||receiveMessage.dCDJX1=="true"){
                $('#dCDJX1').removeClass();
                $('#dCDJX1').addClass('redLight');
            }else if(receiveMessage.dCDJX1=="FALSE"||receiveMessage.dCDJX1=="false"){
                $('#dCDJX1').removeClass();
                $('#dCDJX1').addClass('greenLight');
            }
            if(receiveMessage.dCDJX2=="TRUE"||receiveMessage.dCDJX2=="true"){
                $('#dCDJX2').removeClass();
                $('#dCDJX2').addClass('redLight');
            }else if(receiveMessage.dCDJX2=="FALSE"||receiveMessage.dCDJX2=="false"){
                $('#dCDJX2').removeClass();
                $('#dCDJX2').addClass('greenLight');
            }
            if(receiveMessage.chDXTGZh=="TRUE"||receiveMessage.chDXTGZh=="true"){
                $('#chDXTGZh').removeClass();
                $('#chDXTGZh').addClass('redLight');
            }else if(receiveMessage.chDXTGZh=="FALSE"||receiveMessage.chDXTGZh=="false"){
                $('#chDXTGZh').removeClass();
                $('#chDXTGZh').addClass('greenLight');
            }
            if(receiveMessage.lCXTGZh=="TRUE"||receiveMessage.lCXTGZh=="true"){
                $('#lCXTGZh').removeClass();
                $('#lCXTGZh').addClass('redLight');
            }else if(receiveMessage.lCXTGZh=="FALSE"||receiveMessage.lCXTGZh=="false"){
                $('#lCXTGZh').removeClass();
                $('#lCXTGZh').addClass('greenLight');
            }
            if(receiveMessage.chDTXGZh=="TRUE"||receiveMessage.chDTXGZh=="true"){
                $('#chDTXGZh').removeClass();
                $('#chDTXGZh').addClass('redLight');
            }else if(receiveMessage.chDTXGZh=="FALSE"||receiveMessage.chDTXGZh=="false"){
                $('#chDTXGZh').removeClass();
                $('#chDTXGZh').addClass('greenLight');
            }
            if(receiveMessage.dDY=="TRUE"||receiveMessage.dDY=="true"){
                $('#dDY').removeClass();
                $('#dDY').addClass('redLight');
            }else if(receiveMessage.dDY=="FALSE"||receiveMessage.dDY=="false"){
                $('#dDY').removeClass();
                $('#dDY').addClass('greenLight');
            }
            if(receiveMessage.MFMCTXGZh=="TRUE"||receiveMessage.MFMCTXGZh=="true"){
                $('#MFMCTXGZh').removeClass();
                $('#MFMCTXGZh').addClass('redLight');
            }else if(receiveMessage.MFMCTXGZh=="FALSE"||receiveMessage.MFMCTXGZh=="false"){
                $('#MFMCTXGZh').removeClass();
                $('#MFMCTXGZh').addClass('greenLight');
            }
            if(receiveMessage.fZ12TXGZh=="TRUE"||receiveMessage.fZ12TXGZh=="true"){
                $('#fZ12TXGZh').removeClass();
                $('#fZ12TXGZh').addClass('redLight');
            }else if(receiveMessage.fZ12TXGZh=="FALSE"||receiveMessage.fZ12TXGZh=="false"){
                $('#fZ12TXGZh').removeClass();
                $('#fZ12TXGZh').addClass('greenLight');
            }
            if(receiveMessage.fZ34TXGZh=="TRUE"||receiveMessage.fZ34TXGZh=="true"){
                $('#fZ34TXGZh').removeClass();
                $('#fZ34TXGZh').addClass('redLight');
            }else if(receiveMessage.fZ34TXGZh=="FALSE"||receiveMessage.fZ34TXGZh=="false"){
                $('#fZ34TXGZh').removeClass();
                $('#fZ34TXGZh').addClass('greenLight');
            }
            if(receiveMessage.dDL=="TRUE"||receiveMessage.dDL=="true"){
                $('#dDL').removeClass();
                $('#dDL').addClass('redLight');
            }else if(receiveMessage.dDL=="FALSE"||receiveMessage.dDL=="false"){
                $('#dDL').removeClass();
                $('#dDL').addClass('greenLight');
            }
            if(receiveMessage.fZ56TXGZh=="TRUE"||receiveMessage.fZ56TXGZh=="true"){
                $('#fZ56TXGZh').removeClass();
                $('#fZ56TXGZh').addClass('redLight');
            }else if(receiveMessage.fZ56TXGZh=="FALSE"||receiveMessage.fZ56TXGZh=="false"){
                $('#fZ56TXGZh').removeClass();
                $('#fZ56TXGZh').addClass('greenLight');
            }
            if(receiveMessage.fZ78TXGZh=="TRUE"||receiveMessage.fZ78TXGZh=="true"){
                $('#fZ78TXGZh').removeClass();
                $('#fZ78TXGZh').addClass('redLight');
            }else if(receiveMessage.fZ78TXGZh=="FALSE"||receiveMessage.fZ78TXGZh=="false"){
                $('#fZ78TXGZh').removeClass();
                $('#fZ78TXGZh').addClass('greenLight');
            }
            if(receiveMessage.shNWDD=="TRUE"||receiveMessage.shNWDD=="true"){
                $('#shNWDD').removeClass();
                $('#shNWDD').addClass('redLight');
            }else if(receiveMessage.shNWDD=="FALSE"||receiveMessage.shNWDD=="false"){
                $('#shNWDD').removeClass();
                $('#shNWDD').addClass('greenLight');
            }
            if(receiveMessage.xLChSh=="TRUE"||receiveMessage.xLChSh=="true"){
                $('#xLChSh').removeClass();
                $('#xLChSh').addClass('redLight');
            }else if(receiveMessage.xLChSh=="FALSE"||receiveMessage.xLChSh=="false"){
                $('#xLChSh').removeClass();
                $('#xLChSh').addClass('greenLight');
            }
            if(receiveMessage.dChQSh=="TRUE"||receiveMessage.dChQSh=="true"){
                $('#dChQSh').removeClass();
                $('#dChQSh').addClass('redLight');
            }else if(receiveMessage.dChQSh=="FALSE"||receiveMessage.dChQSh=="false"){
                $('#dChQSh').removeClass();
                $('#dChQSh').addClass('greenLight');
            }
            if(receiveMessage.dChDYD=="TRUE"||receiveMessage.dChDYD=="true"){
                $('#dChDYD').removeClass();
                $('#dChDYD').addClass('redLight');
            }else if(receiveMessage.dChDYD=="FALSE"||receiveMessage.dChDYD=="false"){
                $('#dChDYD').removeClass();
                $('#dChDYD').addClass('greenLight');
            }
            if(receiveMessage.chDGY=="TRUE"||receiveMessage.chDGY=="true"){
                $('#chDGY').removeClass();
                $('#chDGY').addClass('redLight');
            }else if(receiveMessage.chDGY=="FALSE"||receiveMessage.chDGY=="false"){
                $('#chDGY').removeClass();
                $('#chDGY').addClass('greenLight');
            }
            if(receiveMessage.lCGL=="TRUE"||receiveMessage.lCGL=="true"){
                $('#lCGL').removeClass();
                $('#lCGL').addClass('redLight');
            }else if(receiveMessage.lCGL=="FALSE"||receiveMessage.lCGL=="false"){
                $('#lCGL').removeClass();
                $('#lCGL').addClass('greenLight');
            }
            if(receiveMessage.chDGL=="TRUE"||receiveMessage.chDGL=="true"){
                $('#chDGL').removeClass();
                $('#chDGL').addClass('redLight');
            }else if(receiveMessage.chDGL=="FALSE"||receiveMessage.chDGL=="false"){
                $('#chDGL').removeClass();
                $('#chDGL').addClass('greenLight');
            }
            if(receiveMessage.jLGZh=="TRUE"||receiveMessage.jLGZh=="true"){
                $('#jLGZh').removeClass();
                $('#jLGZh').addClass('redLight');
            }else if(receiveMessage.jLGZh=="FALSE"||receiveMessage.jLGZh=="false"){
                $('#jLGZh').removeClass();
                $('#jLGZh').addClass('greenLight');
            }
            if(receiveMessage.lCZhBGZh=="TRUE"||receiveMessage.lCZhBGZh=="true"){
                $('#lCZhBGZh').removeClass();
                $('#lCZhBGZh').addClass('redLight');
            }else if(receiveMessage.lCZhBGZh=="FALSE"||receiveMessage.lCZhBGZh=="false"){
                $('#lCZhBGZh').removeClass();
                $('#lCZhBGZh').addClass('greenLight');
            }
            if(receiveMessage.bCTR=="TRUE"||receiveMessage.bCTR=="true"){
                $('#bCTR').removeClass();
                $('#bCTR').addClass('redLight');
            }else if(receiveMessage.bCTR=="FALSE"||receiveMessage.bCTR=="false"){
                $('#bCTR').removeClass();
                $('#bCTR').addClass('greenLight');
            }

            if(receiveMessage.zdDY=="TRUE"||receiveMessage.zdDY=="true"){
                //修改逻辑
                $('#zdDY').removeClass();
                $('#zdDY').addClass('greyLight');
                $('#sdDY').removeClass();
                $('#sdDY').addClass('greenLight');


            }else if(receiveMessage.zdDY=="FALSE"||receiveMessage.zdDY=="false"){
                $('#zdDY').removeClass();
                $('#zdDY').addClass('greenLight');
                $('#sdDY').removeClass();
                $('#sdDY').addClass('greyLight');

            }

             if(receiveMessage.ycDY=="TRUE"||receiveMessage.ycDY=="true"){
                $('#ycDY').removeClass();
                $('#ycDY').addClass('greenLight');
                $('#bdDY').removeClass();
                $('#bdDY').addClass('greyLight');
            }else if(receiveMessage.ycDY=="FALSE"||receiveMessage.ycDY=="false"){
                $('#ycDY').removeClass();
                $('#ycDY').addClass('greyLight');
                $('#bdDY').removeClass();
                $('#bdDY').addClass('greenLight');
            }

            if(receiveMessage.dmmxw1=="TRUE"||receiveMessage.dmmxw1=="true"){
                $('#dmmxw1').removeClass();
                $('#dmmxw1').addClass('redLight');
            }else if(receiveMessage.dmmxw1=="FALSE"||receiveMessage.dmmxw1=="false"){
                $('#dmmxw1').removeClass();
                $('#dmmxw1').addClass('greenLight');
            }

            if(receiveMessage.dmmxw2=="TRUE"||receiveMessage.dmmxw2=="true"){
                $('#dmmxw2').removeClass();
                $('#dmmxw2').addClass('redLight');
            }else if(receiveMessage.dmmxw2=="FALSE"||receiveMessage.dmmxw2=="false"){
                $('#dmmxw2').removeClass();
                $('#dmmxw2').addClass('greenLight');
            }

            if(receiveMessage.dmmxw3=="TRUE"||receiveMessage.dmmxw3=="true"){
                $('#dmmxw3').removeClass();
                $('#dmmxw3').addClass('redLight');
            }else if(receiveMessage.dmmxw3=="FALSE"||receiveMessage.dmmxw3=="false"){
                $('#dmmxw3').removeClass();
                $('#dmmxw3').addClass('greenLight');
            }

            if(receiveMessage.dcmxw=="TRUE"||receiveMessage.dcmxw=="true"){
                $('#dcmxw').removeClass();
                $('#dcmxw').addClass('redLight');
            }else if(receiveMessage.dcmxw=="FALSE"||receiveMessage.dcmxw=="false"){
                $('#dcmxw').removeClass();
                $('#dcmxw').addClass('greenLight');
            }

            if(receiveMessage.TXGZ=="TRUE"||receiveMessage.TXGZ=="true"){
                $('#TXGZ').removeClass();
                $('#TXGZ').addClass('redLight');
            }else if(receiveMessage.TXGZ=="FALSE"||receiveMessage.TXGZ=="false"){
                $('#TXGZ').removeClass();
                $('#TXGZ').addClass('greenLight');
            }


            if(receiveMessage.ZCSDGD=="TRUE"||receiveMessage.ZCSDGD=="true"){
                $('#ZCSDGD').removeClass();
                $('#ZCSDGD').addClass('redLight');
            }else if(receiveMessage.ZCSDGD=="FALSE"||receiveMessage.ZCSDGD=="false"){
                $('#ZCSDGD').removeClass();
                $('#ZCSDGD').addClass('greenLight');
            }

            if(receiveMessage.JPTXGZSD=="TRUE"||receiveMessage.JPTXGZSD=="true"){
                $('#JPTXGZSD').removeClass();
                $('#JPTXGZSD').addClass('redLight');
            }else if(receiveMessage.JPTXGZSD=="FALSE"||receiveMessage.JPTXGZSD=="false"){
                $('#JPTXGZSD').removeClass();
                $('#JPTXGZSD').addClass('greenLight');
            }

            if(receiveMessage.JPJTSD=="TRUE"||receiveMessage.JPJTSD=="true"){
                $('#JPJTSD').removeClass();
                $('#JPJTSD').addClass('redLight');
            }else if(receiveMessage.JPJTSD=="FALSE"||receiveMessage.JPJTSD=="false"){
                $('#JPJTSD').removeClass();
                $('#JPJTSD').addClass('greenLight');
            }


            if(receiveMessage.DZJGZTYC=="TRUE"||receiveMessage.DZJGZTYC=="true"){
                $('#DZJGZTYC').removeClass();
                $('#DZJGZTYC').addClass('redLight');
            }else if(receiveMessage.DZJGZTYC=="FALSE"||receiveMessage.DZJGZTYC=="false"){
                $('#DZJGZTYC').removeClass();
                $('#DZJGZTYC').addClass('greenLight');
            }


            if(receiveMessage.DCJGCJ1TXGZ=="TRUE"||receiveMessage.DCJGCJ1TXGZ=="true"){
                $('#DCJGCJ1TXGZ').removeClass();
                $('#DCJGCJ1TXGZ').addClass('redLight');
            }else if(receiveMessage.DCJGCJ1TXGZ=="FALSE"||receiveMessage.DCJGCJ1TXGZ=="false"){
                $('#DCJGCJ1TXGZ').removeClass();
                $('#DCJGCJ1TXGZ').addClass('greenLight');
            }


            if(receiveMessage.DCJGCJ2TXGZ=="TRUE"||receiveMessage.DCJGCJ2TXGZ=="true"){
                $('#DCJGCJ2TXGZ').removeClass();
                $('#DCJGCJ2TXGZ').addClass('redLight');
            }else if(receiveMessage.DCJGCJ2TXGZ=="FALSE"||receiveMessage.DCJGCJ2TXGZ=="false"){
                $('#DCJGCJ2TXGZ').removeClass();
                $('#DCJGCJ2TXGZ').addClass('greenLight');
            }


            if(receiveMessage.DCDWGZ=="TRUE"||receiveMessage.DCDWGZ=="true"){
                $('#DCDWGZ').removeClass();
                $('#DCDWGZ').addClass('redLight');
            }else if(receiveMessage.DCDWGZ=="FALSE"||receiveMessage.DCDWGZ=="false"){
                $('#DCDWGZ').removeClass();
                $('#DCDWGZ').addClass('greenLight');
            }


            if(receiveMessage.BMQYC=="TRUE"||receiveMessage.BMQYC=="true"){
                $('#BMQYC').removeClass();
                $('#BMQYC').addClass('redLight');
            }else if(receiveMessage.BMQYC=="FALSE"||receiveMessage.BMQYC=="false"){
                $('#BMQYC').removeClass();
                $('#BMQYC').addClass('greenLight');
            }


            if(receiveMessage.QSBMQ1TXGZ=="TRUE"||receiveMessage.QSBMQ1TXGZ=="true"){
                $('#QSBMQ1TXGZ').removeClass();
                $('#QSBMQ1TXGZ').addClass('redLight');
            }else if(receiveMessage.QSBMQ1TXGZ=="FALSE"||receiveMessage.QSBMQ1TXGZ=="false"){
                $('#QSBMQ1TXGZ').removeClass();
                $('#QSBMQ1TXGZ').addClass('greenLight');
            }


            if(receiveMessage.QSBMQ2TXGZ=="TRUE"||receiveMessage.QSBMQ2TXGZ=="true"){
                $('#QSBMQ2TXGZ').removeClass();
                $('#QSBMQ2TXGZ').addClass('redLight');
            }else if(receiveMessage.QSBMQ2TXGZ=="FALSE"||receiveMessage.QSBMQ2TXGZ=="false"){
                $('#QSBMQ2TXGZ').removeClass();
                $('#QSBMQ2TXGZ').addClass('greenLight');
            }





        });
}



/* 订阅信息 */
function subscribeSocket() {


    // 设置订阅地址
    SUBSCRIBE = SUBSCRIBE_PREFIX + "/test2";
    // 输出订阅地址
    // alert("设置订阅地址为：" + SUBSCRIBE);
    // 执行订阅消息
    stompClient.subscribe(SUBSCRIBE, function (responseBody) {
        var receiveMessage = JSON.parse(responseBody.body);
        console.log(receiveMessage);

        // $("#information").append("<tr><td>" + receiveMessage.content + "</td></tr>");
    });
}

/* 断开连接 */
function disconnect() {
    stompClient.disconnect(function () {
        alert("断开连接");
    });
}

/* 发送消息并指定目标地址（这里设置的目标地址为自身订阅消息的地址，当然也可以设置为其它地址） */
function sendMessageNoParameter() {
    // 设置发送的内容
    var sendContent = $("#content").val();
    // 设置待发送的消息内容
    var message = '{"destination": "' + SUBSCRIBE + '", "content": "' + sendContent + '"}';
    // 发送消息
    stompClient.send(SEND_ENDPOINT, {}, message);
}
